<!DOCTYPE html>
<html>
	<head>
		<script src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js" type="text/javascript"></script>
		<title>web登录界面</title>

		<meta name="keywords" content="web登录界面" />

		<meta name="description" content="最全的web登录界面下载网站http://cn.inspinia.cn" />
		<meta name="viewport" content="width=device-width, initial-scale=1" />
		<script type="application/x-javascript">
			addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); }
		</script>
		<link href="css/style.css" rel="stylesheet" type="text/css" />
	</head>
	<body>
		<script>
			function insertUser() {
				var user = {};
				user.userName = $(".userName").val();
				user.password = $("[type=password]").val();

				// 调用 ajax 函数，参数为 ajax 的配置属性对象
				$.ajax({
					url: "http://www.sfac.xyz/api/login",
					type: "post",
					contentType: "application/json",
					data: JSON.stringify(user),
					success: function (result) {
						if (result.status == 200) {
							alert(result.message);
							console.log(result.data);
							window.location.href =
								"file:///E:/Compiling_file/projectCode/project-code/LeadingEnd/EpidemicBigData/index.html";
						} else {
							alert(result.message);
						}
					},
					error: function (erro) {
						console.log(erro);
					},
				});
			}
		</script>
		<!--start-main-->
		<h1>Welcome!<span>Please login...</span></h1>
		<div class="login-box">
			<form>
				<input
					type="text"
					class="userName"
					value="Username"
					onfocus="this.value = '';"
					onblur="if (this.value == '') {this.value = 'Username';}"
				/>
				<input
					type="password"
					value="Password"
					onfocus="this.value = '';"
					onblur="if (this.value == '') {this.value = 'Password';}"
				/>
			</form>
			<div class="remember">
				<a href="#"><p>Remember me</p></a>
				<h4>Forgot your password?<a href="#">Click here.</a></h4>
			</div>
			<div class="clear"></div>
			<div class="btn">
				<input type="submit" value="LOG IN" onclick="insertUser()" />
			</div>
			<div class="clear"></div>
		</div>
		<!--//End-login-form-->
		<!--start-copyright-->
		<div class="copy-right">
			<p>Template by <a href="https://shop585798004.taobao.com/" target="_blank">前端ui</a></p>
		</div>
		<!--//end-copyright-->
	</body>
</html>
